*** Settings ***
Library    RequestsLibrary
Library    Collections

*** Variables ***
${REDFISH_HOST}       https://127.0.0.1:10443
${REDFISH_USERNAME}   Administrator
${REDFISH_PASSWORD}   Admin@90000
${BIOS_SETTINGS_URI}  /redfish/v1/Systems/1/Bios/Settings

*** Test Cases ***
Get BIOS Settings via Redfish
    [Documentation]    通过Redfish API获取BIOS设置信息

    # 创建认证元组变量
    ${AUTH_CREDENTIALS}    Create List    ${REDFISH_USERNAME}    ${REDFISH_PASSWORD}
    
    # 创建Redfish会话
    Create Session    redfish    ${REDFISH_HOST}    auth=${AUTH_CREDENTIALS}    verify=${False}
    
    # 发送GET请求
    ${response}=    GET On Session    redfish    ${BIOS_SETTINGS_URI}
    
    # 验证响应状态码
    Should Be Equal As Strings    ${response.status_code}    200
    
    # 打印响应内容
    Log    ${response.json()}    level=INFO
    
    # 提取并验证某个BIOS设置项
    # 最重要的是Attribute的内容，但由于qemu里面的settings.json是空的，所以先不验证
    ${bios_settings}=    Set Variable    ${response.json()}
    ${attributes_name}=    Set Variable    Attributes  # 示例属性名
    
    # 检查响应中是否包含特定属性
    Dictionary Should Contain Key    ${bios_settings}    ${attributes_name}
    Log    BIOS设置项${attributes_name}的值为：${bios_settings['${attributes_name}']}    level=INFO
    
    # 关闭会话
    Delete All Sessions